package com.example.delegate.simple;

import java.util.HashMap;
import java.util.Map;

public class Leader {

    private Map<String, IEmployee> register = new HashMap<>();

    public Leader() {
        register.put("product", new ProductEmployee());
        register.put("java", new JavaEmployee());
        register.put("php", new PhpEmployee());
    }

    public void doSomething(String command) {

        if (command.equals("product")) {
            new ProductEmployee().doSomething(command);
        } else if (command.equals("java")) {
            new JavaEmployee().doSomething(command);
        } else if (command.equals("php")) {
            new PhpEmployee().doSomething(command);

        }
    }
}
